/*
 *  node.h
 *  final
 *
 *  Created by Javier Quevedo on 1/21/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */

#if defined(WIN32)
#include <GL/glut.h>
#else
#include <GLUT/glut.h>
#endif

#import "Model.h"



typedef enum ObjectShape            /* Defines an enumeration type    */
{
    OScustom = 0,       /* Names day and declares a       */
    OSsphere  = 1   /* variable named workday with    */ 
} ObjectShape;


typedef struct Rtl{
	GLfloat translation[3];
	GLfloat scale[3];
	GLfloat rotation[4];
}Rtl;

typedef struct MaterialStruct{
		GLfloat specular[4];
		GLfloat shininess;
		GLfloat diffuse[3];
		GLfloat ambient[3];

}MaterialStruct;
	
typedef struct  Node
	{
		enum ObjectShape objectShape;
		struct Rtl rtlMatrix;
		struct MaterialStruct material;
		struct ModelPart *modelPart;
		struct  Node *leftChild;
		struct  Node *rightSibling;
	}Node;

Node *initNode();
void *releaseNode(Node *node);
void renderNode (Node *node);
void transcend(Node *node);
void setModelPart(Node *node, ModelPart *modelPart);
void addChild(Node *node, Node *leftNode);
void setObjectShape(Node *node, ObjectShape something);
void setNodeTranslation(Node *node, GLfloat x, GLfloat y, GLfloat z);
void transLateNode(Node *node, GLfloat x, GLfloat y, GLfloat z);
void setNodeRotation(Node *node, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void rotateNode(Node *node, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void setNodeScale(Node *node, GLfloat x, GLfloat y, GLfloat z);
void scaleNode(Node *node, GLfloat factor, GLfloat x, GLfloat y, GLfloat z);
void setSpecular(Node *node, GLfloat vector[4]);
void setShininess(Node *node, GLfloat shininess);
void setDiffuse(Node *node, GLfloat vector[3]);
void setAmbient(Node *node, GLfloat vector[3]);

